<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="div1">
        <div id="div2"></div>
    </div>
</body>
</html>
<script>
    let node = document.getElementById("div1").firstElementChild;
    console.log(node);
    let button = document.createElement("button");
    button.type="button";
    button.innerHTML = "测试按钮";
    document.getElementById("div2").appendChild(button);

</script>